﻿/**
 * zebron
 * 没有绑定设备对话框
 */

class NotBindEquipDialog extends UiFramework.Dialog
{
    onStart(divSelf: HTMLDivElement)
    {
        // 背景灰色框
        let grayContainer = document.createElement("div");
        grayContainer.className = "grayContainerShow";
        grayContainer.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=3, opacity=25, finishOpacity=75)"; // filter - 定义元素的可视效果
        grayContainer.style.opacity = "0.6"; // 透明度为 0 - 1 之间
        grayContainer.style.zIndex = "10000";
        divSelf.appendChild(grayContainer);

        // 白色对话框
        let whiteFrame = document.createElement("div");
        whiteFrame.className = "whiteFrameShow";
        whiteFrame.style.zIndex = "10001";
        divSelf.appendChild(whiteFrame);

        // 对话框标题前图标
        let dialogImage = document.createElement("img");
        dialogImage.src = "picture/ic_dialog.png";
        dialogImage.style.position = "absolute";
        dialogImage.style.marginTop = "37%";
        dialogImage.style.marginLeft = "28%";
        whiteFrame.appendChild(dialogImage);

        // 对话框标题
        let alertTitle = document.createElement("text");
        alertTitle.innerText = "没有绑定设备";
        alertTitle.style.top = "16%";
        alertTitle.style.left = "4%";
        alertTitle.className = "alertWindowTitle";
        whiteFrame.appendChild(alertTitle);

        // 返回按钮
        let btnReturn = document.createElement("input");
        btnReturn.type = "button";
        btnReturn.value = "返回";
        btnReturn.style.left = "37%";
        btnReturn.style.top = "80%";
        btnReturn.className = "smallGreenButton";
        whiteFrame.appendChild(btnReturn);

        btnReturn.onclick = () =>
        {
            this.onExit();
        }
    }
}

// 弹出对话框管理
DialogMap["notBindEquipDialog"] = () =>
{
    return new NotBindEquipDialog();
}